package com.lamatek.tags.google.beans;

import java.text.SimpleDateFormat;
import java.util.Date;


public class TrafficEventBean {
    
    double longitude = 0.00d;
    double latitude = 0.00d;
    String title = null;
    String description = null;
    String type = null;
    String direction = null;
    Date reported = null;
    Date updated = null;
    Date ending = null;
    int severity = 0;
    /**
     * Empty constructor for a traffic event. All valid traffic events
     * must have a longitude, latitude and description defined to be
     * displayed.
     */
    public TrafficEventBean() {
    }
    /**
     * Returns the display content to show in the traffic event's info window which
     * is displayed when the marker is clicked.
     * 
     * @return An HTML formatted string description of the traffic event.
     */
    public String getContent() {
        String contents = "<div style=\"text-align: left\">";
        contents += "<table>";
        contents += "<tr><th colspan=\"2\">" + title + "</th></tr>";
        contents += "<tr><td colspan=\"2\" style=\"white-space: wrap\">" + description + "</td></tr>";
        contents += "<tr><td>Severity:</td><td width=\"100%\">" + severity + "</td></tr>";
        contents += "<tr><td>Direction:</td><td width=\"100%\">" + direction + "</td></tr>";
        contents += "</table>";
        contents += "</div>";
        return EscapeChars.escape(contents);
    }
    /**
     * Returns the text description for this traffic event.
     * 
     * @return The text description for this traffic event.
     */
    public String getDescription() {
        return description;
    }
    /**
     * Sets the text description for this traffic event.
     * 
     * @param String The text description for this traffic event.
     */
    public void setDescription(String description) {
        this.description = description;
    }
    /**
     * Returns the longitude location for this traffic event.
     * 
     * @return The longitude for this traffoc event.
     */
    public double getLatitude() {
        return latitude;
    }
    /**
     * Sets the longitude location for this traffic event.
     * 
     * @param double Denotes the longitude for this traffoc event.
     */
    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }
    /**
     * Returns the longitude location for this traffic event.
     * 
     * @return The longitude for this traffoc event.
     */
    public double getLongitude() {
        return longitude;
    }
    /**
     * Sets the longitude location for this traffic event.
     * 
     * @param double Denotes the longitude for this traffoc event.
     */
    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }
    /**
     * Returns the traffic event type. Valid values are incident and construction.
     * 
     * @return The type of traffic event. 
     */
    public String getType() {
        return type;
    }
    /**
     * Sets the type of traffic event. Valid values are incident and construction.
     * 
     * @param String The event type.
     */
    public void setType(String type) {
        this.type = type;
    }
    /**
     * Returns the severity of the traffic event, ranging from 1 (least) to 5 (most severe).
     * 
     * @return The event severity as an int.
     */
    public int getSeverity() {
        return severity;
    }
    /**
     * Sets the severity of this event. Valid values are 1 (least severe) to 5 (most severe).
     * 
     * @param int The event severity.
     */
    public void setSeverity(int severity) {
        this.severity = severity;
    }
    /**
     * Returns a descriptive title of this traffic event.
     * 
     * @return The title of this traffic event.
     */
    public String getTitle() {
        return title;
    }
    /**
     * Sets the descriptive title of this traffic event.
     * 
     * @param String Descriptive title of the event.
     */
    public void setTitle(String title) {
        this.title = title;
    }
    /**
     * Returns the direction of the event (if it's an incident that affects one direction
     * of a road, or null.
     */
    public String getDirection() {
        return direction;
    }
    /**
     * Sets the direction of traffic (NB, SB, EB or WB) affected by the incident.
     * 
     * @param String The traffic direction affected.
     */
    public void setDirection(String direction) {
        this.direction = direction;
    }
    /**
     * Returns the expected ending date for this traffic event or null if the expected
     * ending date is unknown.
     * 
     * @return The expected ending date as a Date object.
     */
    public Date getEnding() {
        return ending;
    }
    /**
     * Sets the expected ending date for this traffic event.
     * 
     * @param ending Expected ending date
     */
    public void setEnding(Date ending) {
        this.ending = ending;
    }
    /**
     * Returns the date this traffic event was reported.
     * 
     * @return The date the event was reported.
     */
    public Date getReported() {
        return reported;
    }
    /**
     * Sets the date this traffic event was reported.
     * 
     * @param reported The date the event was reported.
     */
    public void setReported(Date reported) {
        this.reported = reported;
    }
    /**
     * Returns the date the event was last updated.
     * 
     * @return The date the event was last updated.
     */
    public Date getUpdated() {
        return updated;
    }
    /**
     * Sets the date the event was last updated.
     * 
     * @param updated The date the event was last updated.
     */
    public void setUpdated(Date updated) {
        this.updated = updated;
    }
}
